import math


def func(n):
    if isinstance(n, list):
        return sum(n)
    elif isinstance(n, tuple):
        return math.prod(n)

aaa = [1,2,3,4,5]
print(func(aaa))

ttt = (1,2,3,4,5)
print(func(ttt))